import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/home',
        name: 'Home',
        component: Home,
        children: [{
                path: '/tiwen',
                name: 'Tiwen',
                component: () =>
                    import ('../views/tiwen.vue') //体温快报
            },
            {
                path: '',
                redirect: '/tiwen',
                component: () =>
                    import ('../views/login.vue')

            },
            {
                path: '/homego',
                name: 'homego',
                component: () =>
                    import ('../views/hometo.vue')
            },
            {
                path: '/abnormal',
                name: 'abnormal',
                component: () =>
                    import ('../views/abnormal.vue')
            },
            {
                path: '/quarantine',
                name: 'quarantine',
                component: () =>
                    import ('../views/quarantine.vue')
            },
            {
                path: '/tiwenchaxun',
                name: 'tiwenchaxun',
                component: () =>
                    import ('../views/tiwenchaxun.vue')
            },
            {
                path: '/zhongdiangjianhu',
                name: 'zhongdiangjianhu',
                component: () =>
                    import ('../views/zhongdiangjianhu.vue')
            },
            {
                path: '/guiji',
                name: 'guiji',
                component: () =>
                    import ('../views/huodongguiji.vue')
            },
            {
                path: '/jinchu',
                name: 'jinchu',
                component: () =>
                    import ('../views/jinchu.vue')
            },
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () =>
            import ('../views/login.vue')
    },
    {
        path: '/about',
        name: 'About',
        component: () =>
            import ('../views/About.vue')
    },
    {
        path: '',
        redirect: '/login',
        component: () =>
            import ('../views/login.vue')
    },

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router